package myapp.advancedapp.service;

import android.app.Notification;
import android.app.Service;
import android.content.Intent;
import android.os.IBinder;
import android.os.RemoteException;
import android.support.annotation.IntDef;
import android.support.annotation.Nullable;

import myapp.advancedapp.UserAidl;

/**
 * Created by 超 on 2017/7/11.
 */

public class MessageService extends Service {
    int massageid = 1;
    @Override
    public void onCreate() {
        super.onCreate();
    }

    @Override
    public int onStartCommand(Intent intent,  int flags, int startId) {
        startForeground(1,new Notification());


        return START_STICKY;
    }

    @Nullable
    @Override
    public IBinder onBind(Intent intent) {
        return stub;
    }

    private final UserAidl.Stub stub= new UserAidl.Stub() {
        @Override
        public void basicTypes(int anInt, long aLong, boolean aBoolean, float aFloat, double aDouble, String aString) throws RemoteException {

        }

        @Override
        public String getUserName() throws RemoteException {
            return "yang2chao3@outlook.com";
        }

        @Override
        public String getPassword() throws RemoteException {
            return "123456";
        }
    };
    private class UserBinder implements UserAidl{

        @Override
        public void basicTypes(int anInt, long aLong, boolean aBoolean, float aFloat, double aDouble, String aString) throws RemoteException {

        }

        @Override
        public String getUserName() throws RemoteException {
            return null;
        }

        @Override
        public String getPassword() throws RemoteException {
            return null;
        }

        @Override
        public IBinder asBinder() {
            return null;
        }
    }
}
